<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCarCategoriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('car_categories', function (Blueprint $table) {
            $table->id();

            $table->integer('pid')->default(0)->comment('父级id');
            $table->string('name')->nullable()->comment('分类名称');
            $table->string('picture')->nullable()->comment('分类图片');
            $table->string('icon')->nullable()->comment('分类图标');
            $table->tinyInteger('show')->default(1)->comment('是否显示');
            $table->tinyInteger('sort')->default(0)->comment('排序');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('car_categories');
    }
}
